package com.abel.roommanager.provider;

import org.apache.ibatis.jdbc.SQL;

import com.abel.roommanager.pojo.Student;

public class StudentsCountSql {
      public String  getStudentCountsSql(Student student) {
    	  SQL sql=new SQL().SELECT("count(*)").FROM("student");
   	   if (student.getSname()!=null&&student.getSname().length()!=0) {
   		sql.WHERE("sname like '"+student.getSname()+"'");
   	}
   	   if (student.getCid()!=0) {
   		sql.WHERE("cid="+student.getCid());
   	}
   	   if (student.getRoomno()!=0) {
   		sql.WHERE("roomno="+student.getRoomno());
   	}
    	  
		return sql.toString();
    	  
      }
}
